<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCoinsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('coins', function (Blueprint $table) {
            $table->increments('id')->comment('币种ID');
            $table->string('name')->comment('名称');
            $table->string('img')->comment('币种图片');
            $table->string('chain_type')->default(null)->comment('协议');
            $table->boolean('can_recharge')->nullable()->default(false)->comment('充值开关:0-不可充值  1-可充值');
            $table->boolean('can_withdraw')->nullable()->default(false)->comment('提现开关:0-不可提  1-可提');
            $table->unsignedDecimal('withdraw_min', 20, 8)->nullable()->default(0.0001)->comment('单次提现最小量');
            $table->unsignedDecimal('withdraw_max', 20, 8)->nullable()->default(10000)->comment('单次提现最大量');
            $table->unsignedDecimal('withdraw_fee', 20, 8)->nullable()->default(0)->comment('单次提现手续费');
            $table->boolean('is_otc')->nullable()->default(false)->comment('是否支持法币交易:0-不支持  1-支持');
            $table->boolean('is_spot')->nullable()->default(false)->comment('是否支持币币交易:0-不支持  1-支持');
            $table->boolean('is_tag')->nullable()->default(false)->comment('是否需要标签:0-不需要  1-需要');
            $table->text('withdraw_prompt')->nullable()->default(null)->comment('提现提示');
            $table->text('recharge_prompt')->nullable()->default(null)->comment('充值提示');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('coins');
    }
}
